//
//  JiGuangAdsSplashScapegoat.m
//  ABUAdDemo
//
//  Created by 刘娟 on 2022/12/27.
//  Copyright © 2022 bytedance. All rights reserved.
//

#import "JiGuangAdsSplashScapegoat.h"

@implementation JiGuangAdsSplashScapegoat
#pragma mark - JgAdsSplashAdDelegate

/**
 *  开屏广告请求成功
 */
- (void)jgadsSplashAdSuccessLoad:(JgAdsSplashAd *)splashAd {
    
}

/**
 *  开屏广告素材加载成功
 */
- (void)jgadsSplashAdDidLoad:(JgAdsSplashAd *)splashAd {
//    CFAbsoluteTime linkTime1 = (CFAbsoluteTimeGetCurrent() - _startTime);
//    NSLog(@"createHDWallet ： %f ms", linkTime1 * 1000);
    NSMutableDictionary *parames = [NSMutableDictionary dictionary];
    NSLog(@"==============极光ads竞价价格：%ld",(long)splashAd.bidPrice);
    if (self.isBidType && splashAd.bidPrice > 0) {
        [parames setValue:[NSString stringWithFormat:@"%ld",splashAd.bidPrice] forKey:BUMMediaAdLoadingExtECPM];

    }
    [self.splashAdapter.bridge splashAd:self.splashAdapter didLoadWithExt:parames];
}

/**
 *  开屏广告请求失败
 */
- (void)jgadsSplashAdFailLoad:(JgAdsSplashAd *)splashAd withError:(NSError *)error {
    NSLog(@"极光ads加载失败：%@",error);
    [self.splashAdapter.bridge splashAdDidShowFailed:self.splashAdapter error:error];
}
/**
 *  开屏广告展示失败
 */
- (void)jgadsSplashAdRenderFaild:(JgAdsSplashAd *)splashAd withError:(NSError *)error {
    NSLog(@"极光ads展示失败：%@",error);
    [self.splashAdapter.bridge splashAd:self.splashAdapter didRenderFailedWithError:error];
}

/**
 *  开屏广告曝光回调
 */
- (void)jgadsSplashAdExposured:(JgAdsSplashAd *)splashAd {
    [self.splashAdapter.bridge splashAdWillVisible: self.splashAdapter];
}

/**
 *  开屏广告点击回调
 */
- (void)jgadsSplashAdClicked:(JgAdsSplashAd *)splashAd {
    [self.splashAdapter.bridge splashAdDidClick:self.splashAdapter];
    [self.splashAdapter.bridge splashAdDidClose:self.splashAdapter];
}

/**
 *  开屏广告倒计时结束回调
 */
- (void)jgadsSplashAdCountdownToZero:(JgAdsSplashAd *)splashAd {
    [self.splashAdapter.bridge splashAdDidCountDownToZero:self.splashAdapter];
}

/**
 *  开屏广告点击跳过回调
 */
- (void)jgadsSplashAdSkiped:(JgAdsSplashAd *)splashAd {
    [self.splashAdapter.bridge splashAdDidClickSkip:self.splashAdapter];
}

/**
 *  开屏广告关闭回调
 */
- (void)jgadsSplashAdClosed:(JgAdsSplashAd *)splashAd {
    splashAd = nil;
    [self.splashAdapter.bridge splashAdDidClose:self.splashAdapter];
}
/**
 *  开屏广告关闭落地页回调
 */
- (void)jgadsSplashAdCloseLandingPage:(JgAdsSplashAd *)splashAd{
    [self.splashAdapter.bridge splashAdWillDismissFullScreenModal:self.splashAdapter];
}


@end
